home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000184_icon-group-sender _Wed Aug 14 10:26:46 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 14 Aug 1996 13:12:03 MST
Date: Wed, 14 Aug 1996 10:26:46 -0500
Message-Id: <199608141526.KAA01341@ns1.computek.net>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: gep2@computek.net
Subject: Problem with graphics
To: rjhare@tattoo.ed.ac.uk, icon-group@cs.arizona.edu
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
>I wish to superimpose a dashed grid on my window to use as a guide for the
positioning of objects (and some text) to be drawn in the window. When I
save the window, I do not want the positioning grid to be part of the saved
image. I cannot redraw the grid with "drawop=reverse" because that may well
'undraw' some components of the objects I have drawn. Any thoughts about how
to do this please?
This is rather like the "sprites" question which comes up all the time in the
design and implementation of video games.
There are a whole variety of approaches that can be used, which fall into at
least three types of categories:
1) reconstruction... prior to saving, you reconstruct the image but without the
grid (this is the kind of thing that AutoCAD does).
2) masking... when you're drawing on the grid, you keep a separate mask which
records where the objects are that are drawn since the grid. Before saving, you
then use the mask to clear (or merge from another image, perhaps) everything
drawn previously (i.e. all the background).
3) palette tricks... where you use a special color (or a small number of
special colors) in your grid and background and ensure that the same exact
colors are not duplicated in the objects drawn later. Then before saving, you
either clear all pixels of the "special" colors, or else you reload the palette
so that pixels of the "special" colors are displayed in the same color as the
surrounding background.
In short, there is no one "right" solution to this issue... it all depends on a
whole variety of tradeoffs of speed, complexity, memory utilization, etc. etc.
Gordon Peterson
http://www.computek.net/public/gep2/